package cn.edu.ctbu.datajpa01.helper;

import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class Result<T> {
    /**错误代码*/
    private Integer code;
    /**提示信息*/
    private String msg;
    /***具体的内容*/
    private T data;
    public static Result success(Object object){
        Result result=new Result();
        result.setData(1);
        result.setData(object);
        result.setMsg("成功");
        return result;
    }
    public static Result success(){
        return success(null);
    }
    public static Result error(Integer code,String msg){
        Result result=new Result();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }

    public static Result ok() {
        return null;
    }
}


